home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / t_unix / j109lxa4.tar / telnet.h < prev    next >
C/C++ Source or Header  |  1994-06-04  |  1KB  |  59 lines

  1. #ifndef    _TELNET_H
  2. #define    _TELNET_H
  3.  
  4. #ifndef _SESSION_H
  5. #include "session.h"
  6. #endif
  7.  
  8. #define    LINESIZE    256    /* Length of local editing buffer */
  9.  
  10. /* Telnet command characters */
  11. #define    IAC        255    /* Interpret as command */
  12. #define    WILL        251
  13. #define    WONT        252
  14. #define    DO        253
  15. #define    DONT        254
  16. #define    SB        250
  17. #define    SE        240
  18.  
  19. #define TN_LINEMODE 34
  20.  
  21. #define    TS_IS        0
  22. #define    TS_SEND        1
  23.  
  24. /* Telnet options */
  25. #define    TN_TRANSMIT_BINARY    0
  26. #define    TN_ECHO            1
  27. #define    TN_SUPPRESS_GA        3
  28. #define    TN_STATUS        5
  29. #define    TN_TIMING_MARK        6
  30. #define    NOPTIONS        6
  31.  
  32. /* Telnet protocol control block */
  33. struct telnet {
  34.     char local[NOPTIONS];    /* Local option settings */
  35.     char remote[NOPTIONS];    /* Remote option settings */
  36.     struct session *session;    /* Pointer to session structure */
  37.     char eolmode;        /* Control translation of enter key */
  38. };
  39. #define    NULLTN    (struct telnet *)0
  40.  
  41. extern int Refuse_echo;
  42. extern int Tn_cr_mode;
  43.  
  44. /* In telnet.c: */
  45. int tel_connect __ARGS((struct session *sp,char *fsocket,int len));
  46. void tel_output __ARGS((int unused,void *p1,void *p2));
  47. void tnrecv __ARGS((struct telnet *tn));
  48. void doopt __ARGS((struct telnet *tn,int opt));
  49. void dontopt __ARGS((struct telnet *tn,int opt));
  50. void willopt __ARGS((struct telnet *tn,int opt));
  51. void wontopt __ARGS((struct telnet *tn,int opt));
  52. void answer __ARGS((struct telnet *tn,int r1,int r2));
  53.  
  54. /* In ttylink.c: */
  55. void ttylhandle __ARGS((int s,void *unused,void *p));
  56.  
  57. #endif    /* _TELNET_H */
  58.  
  59.